package frontend;

import java.util.*;

public class FunctionSymbolEntry {
	public String name;
	public String returnType;
	public ArrayList<String> args;
	
	public FunctionSymbolEntry(SyntaxTreeNode userFuncNode) {
		this.name = SyntaxTreeNodeUtil.getUserFuncName(userFuncNode);
		this.returnType = SyntaxTreeNodeUtil.getUserFuncReturnType(userFuncNode);
		this.args = SyntaxTreeNodeUtil.getUserFuncArgList(userFuncNode);
	}
	
	public FunctionSymbolEntry(String InputName, String InputType, Class<?>[] InputArgs, int removeArg) {
        this.name = InputName;
        this.returnType = InputType;
        this.args=new ArrayList<String>();
        for(Class<?> argtype : InputArgs)
        {
                args.add(SyntaxTreeNodeUtil.TranslateFromJavaType(argtype.getName()));
        }
        if(removeArg > 0 && args.size() >0){
        	args.remove(args.size()-1);
        }
    }
    

}
